package com.inlycat.entity;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author jarvan4dev@163.com
 * @since 2015年8月12日下午1:10:52
 * @category 账户的流水账信息实体类
 */

//json转换的时候，用于过滤null字段
//@JsonInclude(Include.NON_NULL)
public class AccountRecord implements Serializable {

	private static final long serialVersionUID = 4588203236165223743L;

	/**
	 * 流水编号
	 */
	private Long id;

	/**
	 * 用户ID
	 */
	private Long userId;
	/**
	 * 交易类型
	 */
	private Integer type;
	/**
	 * 交易额
	 */
	private Integer amount;
	/**
	 * 交易描述
	 */
	@Length(max = 30, message = "{accountRecord.describle.length}")
	private String describle;
	/**
	 * 交易时间
	 */
	@Past(message = "{accountRecord.time.past}")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")//格式化日期
	private Date time;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	public String getDescrible() {
		return describle;
	}

	public void setDescrible(String describle) {
		this.describle = describle;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	@Override
	public String toString() {
		return "AccountRecord [id=" + id + ", userId=" + userId + ", type="
				+ type + ", amount=" + amount + ", describle=" + describle
				+ ", time=" + time + "]";
	}

}
